﻿/**
 * Created by Administrator on 2017/8/7.
 */
define(function () {
    var VisitRecordInfo = {
        name: 'visit-record-info',
        template: ''
        + '<li class="clearfix" v-bind:id="tradedId">'
        + '    <div class="left-icon left-call-icon" v-if="visitRecord.IsVisited && visitRecord.VisitType===\'电话回访\'"></div>'
        + '    <div class="left-icon left-airport-icon" v-if="visitRecord.IsVisited && visitRecord.VisitType===\'接机回访\'"></div>'
        + '    <div class="left-icon left-look-icon" v-if="visitRecord.IsVisited && visitRecord.VisitType===\'带看回访\'"></div>'
        + '    <div class="left-icon left-traded-icon" v-if="visitRecord.IsVisited && visitRecord.VisitType===\'成交回访\'"></div>'
        + '    <div class="left-icon left-plan-icon" v-if="visitRecord.IsVisited===false"></div>'
        + '    <div class="right-conent" v-if="visitRecord.IsVisited">'
        + '        <div class="right-conent-top">'
        + '            <span>回访人： <i>{{visitRecord.VisitorName}}</i></span>'
        + '            <span v-if="visitRecord.VisitType===\'成交回访\'">成交时间：<i>{{visitRecord.TradedTime}}</i></span>'
        + '            <span v-else>回访时间：<i>{{visitRecord.VisitTime}}</i></span>'
        + '            <span v-if="visitRecord.VisitType===\'接机回访\'">航班号：<i>{{visitRecord.Flight}}</i></span>'
        + '            <span v-if="visitRecord.VisitType===\'电话回访\'">电话号码：<i>{{visitRecord.CallNo}}</i></span>'
        + '            <span v-if="visitRecord.VisitType===\'成交回访\'">协助人员：<i>{{visitRecord.HelperList.length===0?"无":visitRecord.HelperList.join(",")}}</i></span>'
        + '        </div>'
        + '        <p class="look" v-if="visitRecord.VisitType===\'带看回访\'">带看房源：<em v-for="item in visitRecord.VisitHouseIdList"  style="margin-left:6px;">{{item}}; </em>'
        + '        </p>'
        + '        <span v-html="visitRecord.RemarkHtml"></span>'
        + '        <div class="right-conent-btm">'
        + '            <em v-for="item in visitRecord.VisitRecordCustomProperty">{{item}}</em>'
        + '            <i class="online" v-bind:class="{ \'no-online\': visitRecord.IsFail}">{{!visitRecord.IsFail?"回访成功":"回访失败"}}</i>'
        + '            <i class="strong" v-bind:class="classPurchasingIntention">{{visitRecord.PurchasingIntentionText}}</i>'
        + '        </div>'
        + '    </div>'
        + '    <div class="right-conent" v-if="visitRecord.IsVisited===false">'
        + '        <div class="right-conent-top">'
        + '            <span>回访人： <i>{{visitRecord.VisitorName}}</i></span>'
        + '            <span>回访时间：<i>{{visitRecord.PlannedTime}}</i></span>'
        + '            <span>回访类型：<i>{{visitRecord.VisitType}}</i></span>'
        + '            <span v-if="visitRecord.VisitType===\'接机回访\'">航班号：<i>{{visitRecord.Flight}}</i></span>'
        + '        </div>'
        + '        <p class="look" v-if="visitRecord.VisitType===\'带看回访\'">带看房源：<em v-for="(item,index) in visitRecord.VisitHouseIdList" style="margin-left:6px;">{{item}}<span style="color:#0099FF;">{{visitRecord.LookedStatusList[index]}};</span> </em>'
        + '        </p>'
        + '    </div>'
        + '</li>',
        props: {
            visitRecord: {
                type: Object,
                required: true
            },
        },
        data: function () {
            return {
                whole: '',
            }
        },
        computed: {
            classPurchasingIntention: function () {
                return "strong" + (this.visitRecord.PurchasingIntention+1);
            },
            tradedId: function () {
                return "_" + (this.visitRecord.Id);
            }
        },
    };
    return VisitRecordInfo;
});

